import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHistory(),
    routes: [
        {
            path: "/",//主页只有/
            name: "index",
            component: () => import("@v/page.vue"),
        },
        //嵌套路由
        {
            path: "/page",
            name: 'user',
            component: () => import("@v/page.vue"),
            children:[
                {
                    path: "/allAllocation",
                    name: '所有分配',
                    component: () => import("@v/allAllocation.vue")
                },
                {
                    path: "/problemAllocation",
                    name: '问题分配',
                    component: () => import("@v/problemAllocation.vue")
                },
                {
                    path: "/noneAllocation",
                    name: '未分配',
                    component: () => import("@v/noneAllocation.vue")
                },
                {
                    path: "/test",
                    name: '测试',
                    component: () => import("@v/test.vue")
                },
            ]
        },
    ], // `routes: routes` 的缩写
});

export default router